<?php

/**
 * 文件由尚数增量代码引擎生成
 * @author: Shann 851188611@qq.com
 */

namespace app\admin\controller;

class MemberBase
{
    public function index()
    {
        $members = \app\model\Member::field(['id', 'user_id', 'started_at', 'ended_at']);

        $members->order('id', 'desc');

        $data['members'] = $members->select();

        return json(['code' => 20000, 'data' => $data]);
    }

    public function detail()
    {
        $member = \app\model\Member::field(['id', 'user_id', 'started_at', 'ended_at']);

        $member->where('id', input('id'));

        $data['member'] = $member->find();

        return json(['code' => 20000, 'data' => $data]);
    }
}
